package com.itheima.controller.user;

import com.itheima.constant.ShopConstant;
import com.itheima.result.Result;

import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("userShopController")
@RequestMapping("/user/shop")
@Api(tags = "C端-店铺相关接口")
@Slf4j
public class ShopController {

    @Autowired
    private RedisTemplate redisTemplate;

    @GetMapping("/status")
    public Result getShopStatus(){
        Object o = redisTemplate.opsForValue().get(ShopConstant.SHOP_STATUS_REDIS_KEY);
        return Result.success(o);
    }
}